package com.sdkj.jiang.controller;

import com.sdkj.jiang.po.Dept;
import com.sdkj.jiang.po.child.DeptImpl;
import com.sdkj.jiang.service.DeptService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/deptController")
public class DeptController {
    @Resource
    private DeptService deptService;
    @RequestMapping("/search")
    public List<DeptImpl> search(){
        List<DeptImpl> depts = deptService.find();
        return  depts;
    }
    //查询部门编号和名称
    @RequestMapping("/searchAll")
    public List<Dept> searchAll(){
        return deptService.findAll();
    }

}
